//
//  NRWApplyMortgageVC.m
//  Finance
//
//  Created by 邢毅 on 2018/7/31.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWApplyMortgageVC.h"
#import "NRWApplyMortgageTopView.h"
#import "NRWApplyMortgageCell.h"
#import "NRWApplyMortgageHeaderView.h"

@interface NRWApplyMortgageVC ()<NRWApplyMortgageTopViewDelegate, UITableViewDelegate, UITableViewDataSource>

@property (strong, nonatomic) NRWApplyMortgageHeaderView *headerView;

@end

@implementation NRWApplyMortgageVC
{
	NRWApplyMortgageTopView *_topView;
	UITableView *_tableView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
	
	self.navigationView.title = @"申请抵押车辆";
	self.view.backgroundColor = getColor(@"e5e5e5");
	
	[self setupUI];
}

- (void)setupUI {
	
	_topView = [[NRWApplyMortgageTopView alloc] init];
	_topView.frame = CGRectMake(0, getNavHeight(), SCREEN_WIDTH(), 30);
	_topView.delegate = self;
	[self.view addSubview:_topView];
	
	self.headerView = [[NRWApplyMortgageHeaderView alloc] init];
	self.headerView.frame = CGRectMake(0, _topView.viewMaxY, SCREEN_WIDTH(), 30);
	self.headerView.dataSize = @"100";
	[self.view addSubview:self.headerView];
	
	_tableView = [[UITableView alloc] init];
	_tableView.frame = CGRectMake(0, self.headerView.viewMaxY, SCREEN_WIDTH(), SCREEN_HEIGHT() - self.headerView.viewMaxY);
	_tableView.backgroundColor = [UIColor whiteColor];
	_tableView.delegate = self;
	_tableView.dataSource = self;
	[_tableView registerNib:[UINib nibWithNibName:@"NRWApplyMortgageCell" bundle:nil] forCellReuseIdentifier:@"cell"];
	[self.view addSubview:_tableView];
	
}

#pragma mark - NRWApplyMortgageTopViewDelegate
- (void)applyMortgageTopView:(NRWApplyMortgageTopView *)view btnDidClick:(UIButton *)sender btnTag:(NSInteger)btnTag {
	
	
}

#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
	
	return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
	
	return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	NRWApplyMortgageCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
	
	cell.firstString = @"第一精品车商城";
	cell.secondString = @"所属市场: 青岛市场";
	cell.thirdString = @"订单号: 009988989";
	cell.fourthString = @"2015-09-09 12:00:00";
	
	return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	return 115;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
	
	
}

#pragma mark - getter

@end
